package com.example.service.impl;

import com.example.mapper.tMesTileChooseMapp;
import com.example.pojo.queryResult;
import com.example.pojo.tMesProMaterialPojo;
import com.example.pojo.tMesTileChoosePojo;
import com.example.service.tMesTileChooseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class tMesTileChooseImpl implements tMesTileChooseService {
    @Autowired
    private tMesTileChooseMapp tMesTileChooseMapp;

    //多条件查询发动机的选瓦数据
    public queryResult queryChoose(Map<String, Object> map) {
        String engineNumber = (String) map.get("engineNumber");
        String timeStart = (String) map.get("timeStart");
        String timeEnd = (String) map.get("timeEnd");
        List<tMesTileChoosePojo> partList = tMesTileChooseMapp.queryChoose(engineNumber,timeStart,timeEnd);

        //组织数据到设定的格式内容中，将结果统一返回
        queryResult queryResult = new queryResult();
        queryResult.setData(partList);
        queryResult.setTotal(partList.size());

        return queryResult;
    }
}
